package gspushmq.model;

public class ApiMessageType {

	private String api_url;
	
	private String params;
	
	private String reqeust_id;
	
	private String mq_sub_type;
	
	private String user_type="all";
	
	public String getUser_type() {
		return user_type;
	}

	public void setUser_type(String user_type) {
		this.user_type = user_type;
	}

	public String getMq_sub_type() {
		return mq_sub_type;
	}

	public void setMq_sub_type(String mq_sub_type) {
		this.mq_sub_type = mq_sub_type;
	}

	public String getApi_url() {
		return api_url;
	}

	public void setApi_url(String api_url) {
		this.api_url = api_url;
	}

	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}

	public String getReqeust_id() {
		return reqeust_id;
	}

	public void setReqeust_id(String reqeust_id) {
		this.reqeust_id = reqeust_id;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		String apiUrl = api_url.intern();
		String requestId = reqeust_id.intern();
		String mqSubType = mq_sub_type.intern();
		result = prime * result + ((apiUrl == null) ? 0 : apiUrl.hashCode());
		result = prime * result + ((requestId == null) ? 0 : requestId.hashCode());
		result = prime * result + ((mqSubType == null) ? 0 : mqSubType.hashCode());
		return result;
	}

	
	public String getMessageFlag(){
		String apiUrl = api_url.intern();
		String requestId = reqeust_id.intern();
		String mqSubType = mq_sub_type.intern();
		return "api_url=" + apiUrl + "|reqeust_id=" + requestId+"|mq_sub_type=" + mqSubType;
	}
	
	@Override
	public boolean equals(Object obj) {
		
		if(obj == this){
			return true;
		}else if(obj == null){
			return false;
		}else if(!(obj instanceof ApiMessageType)){
			return false;
		}
		ApiMessageType mo = (ApiMessageType)obj;
		return this.getMessageFlag().equals(mo.getMessageFlag());
		
	}
}
